<?php

	Class DBConnection {
		
	var $strServer; // Server IP Address 'or' Name
	var $strDatabase ; // Database Name
	var $strUser ; // User ID
	var $strPwd ; // Password
	var $connection; // Connection

	function DBConnection(){
			
		$this->strServer="127.0.0.1"; // Server IP Address 'or' Name
		$this->strDatabase="audit"; // Database Name
		$this->strUser="root"; // User ID
		$this->strPwd="root"; // Password
	
	}

	function createConnection(){
		
	$this->connection= mysql_connect($this->strServer, $this->strUser, $this->strPwd);
	
	if (!$this->connection) {
	   	 die('Could not connect: ' . mysql_error());
	}
	else {
		mysql_select_db($this->strDatabase, $connection);
		echo 'Connected successfully';
	}
		
	}
	
	function getData($queryStr){
		print($queryStr);
		return  mysql_query($queryStr);
	}
	
	function closeConnection(){
		
		mysql_close($this->connection);
	}
	
	function getConnection(){		
		return $this->connection;
	}
		
		
	}
?>